package Work;

import java.util.ArrayList;

public class PrintList {
	//打印图书列表
    public void printbookList(ArrayList<Book> list){
        System.out.println("ID\t\t\tName\t\t\t\tAuthor\t\t\t\tPrice\t\tAmount");
        //遍历book列表，并打印对应属性
        for(Book book:list){
            System.out.println(book.getId()+"\t\t"+book.getName()+"\t\t\t\t"
                    +book.getAuthor()+"\t\t\t\t"+book.getPrice()+"\t\t"+book.getAmount());
        }
    }
    public void printreaderList(ArrayList<Reader> list){
        System.out.println("ID\t\tName\t\t\tNumber\t\t\tInstitute");
        //遍历book列表，并打印对应属性
        for(Reader reader:list){
            System.out.println(reader.getID()+"\t"+reader.getName()+"\t\t\t"
                    +reader.getNumber()+"\t\t\t\t"+reader.getInstitute());
        }
    }
    
  //打印完整管理员信息表
    public void printlibrarianList(ArrayList<Librarian> list){
        System.out.println("ID\t\t\tName\t\t\tNumber");
        //遍历列表，并打印对应属性
        for(Librarian librarian:list){
            System.out.println(librarian.getID()+"\t"+librarian.getName()+"\t\t\t"
                    +librarian.getNumber()+"\t\t\t\t");
        }
    }
    public void printrecordList(ArrayList<Record> list){
        System.out.println("ID\t\tName\t\t\tNumber\t\t\tInstitute");
        //遍历book列表，并打印对应属性
        for(Record reader:list){
            System.out.println(reader.getB_ID()+"\t"+reader.getR_ID()+"\t");//+reader.getName()+"\t\t\t"
                    //+reader.getNumber()+"\t\t\t\t"+reader.getInstitute());
        }
    }
}
